package com.kantboot.tool.edu.repository;

import com.kantboot.tool.edu.domain.entity.ToolEduMajor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ToolEduMajorRepository extends JpaRepository<ToolEduMajor,Long> {

    /**
     * 根据lv查询
     * @param lv 等级
     */
    @Query("""
    FROM ToolEduMajor
    WHERE lv = :lv
    """)
    List<ToolEduMajor> findByLv(Integer lv);

    @Query("""
    FROM ToolEduMajor
    WHERE code = :code
    """)
    ToolEduMajor findByCode(String code);

}
